#ifndef TRACKCONTROLLER_H
#define TRACKCONTROLLER_H

#include <QWidget>
#include <phonon/audiooutput.h>
#include <phonon/seekslider.h>
#include <phonon/mediaobject.h>
#include <phonon/volumeslider.h>
#include <phonon/backendcapabilities.h>

QT_BEGIN_NAMESPACE
class QLCDNumber;
class QAction;
QT_END_NAMESPACE

class Track;

class TrackController : public QWidget
{
    Q_OBJECT

public:
    TrackController(QWidget *parent = 0);
    ~TrackController();

signals:
    void positionChanged(double time);

private slots:
    void trackChanged(Track *track);
    void stateChanged(Phonon::State newState, Phonon::State oldState);
    void tick(qint64 time);
    void sourceChanged(const Phonon::MediaSource &source);

private:
    void setupActions();
    void setupUi();

    Phonon::SeekSlider *seekSlider;
    Phonon::MediaObject *mediaObject;
    Phonon::AudioOutput *audioOutput;

    QAction *playAction;
    QAction *pauseAction;
    QAction *stopAction;

    QLCDNumber *timeLcd;
};


#endif // TRACKCONTROLLER_H
